/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.toools.gwt.wmc.server;

import javax.servlet.http.HttpServletRequest;
import org.toools.gwt.wmc.jpa.Account;

/**
 *
 * @author roman schoenbichler
 */
public class WMCSession {

    public static Boolean isAdmin( HttpServletRequest request ) {
        //return request.getSession().getAttribute("isadmin") != null && request.getSession().getAttribute("isadmin").equals( true );
        return true;
    }

    public static void setAccount( HttpServletRequest request, Account a ) {
//        request.getSession().setAttribute( "userid", a.getId() );
//        request.getSession().setAttribute( "isadmin", a.isAdmin() );
    }

    public static void removeAccount( HttpServletRequest request ) {
//        request.getSession().removeAttribute( "userid" );
//        request.getSession().removeAttribute( "isadmin" );
    }

    public static Integer getAccountID( HttpServletRequest request ) {
//        return (Integer) request.getSession().getAttribute("accountid");
        return 0;
    }
}
